package com.summer.study.leetcode.simple_class;

/**
 * @auther: 杨杰
 * @date: 2019/7/30 09:17
 * @description: 斐波拉契数列
 */
public class Fibonacci {

    private static int fibonacci(int n) {
        if (n <= 0) {
            return 0;
        } else if (n == 1) {
            return 1;
        } else {
            return fibonacci(n - 1) + fibonacci(n - 2);
        }
    }

    public static void main(String[] args) {
        System.out.println(fibonacci(6));
    }

}
